<style>

.headsub {
    background: none repeat scroll 0 0 #FCF4CD;
    border: 1px solid #FFFFFF;
    height: 32px;
	width:935px;
}
 .headsub p {
    color: #0065BB;
    font-weight: bold;
    margin: 0;
    padding: 7px;
}
</style>
<script language="javascript">
function relink(dgdan)
{
window.location.href=dgdan;
}
function resubmit(frmname,links)
{
var f = document.forms[frmname];
f.action = links;
f.submit();
}
</script>
<div id="middle" class="company">	
	<div class="title">			
		<h1 style="font-size:20px;">Hỗ trợ kinh doanh </h1>
	</div>
	
	<div class="content">
    	
		<div id="contents" title="" style="overflow:none;"> 
        	<div class="headsub"><p>Giỏ hàng của bạn</p></div>
            <table width="936px" cellspacing="1" cellpadding="1" border="0" bgcolor="#CCCCCC">
        <form action="" name="frmorder" id="frmorder" method="post">
          <tbody><tr bgcolor="#FFFFFF" style="height:35px;"> 
            <td class="headorder" width="6%"><center>TT</center></td>
            <td class="headorder" width="4%"><center>Mã</center></td>
            <td class="headorder" width="24%"><center>Tên sản phẩm</center> </td>
              <td class="headorder" width="13%"><center>Giá SP</center> </td>
            <td class="headorder" width="13%"><center>Giá thàn viên</center></td>
            <td class="headorder" width="16%"><center>Số lượng</center></td>
            <td class="headorder" width="15%"><center>Tổng tiền (VND)</center> </td>
            <td class="headorder" width="15%"><center>Tổng PV</center> </td>
            <td class="headorder" width="20%"><center>Xóa</center></td>
          </tr>
          <?php foreach($shows as $key=>$show){ $i=$key +1;?>
       
          <tr bgcolor="#FFFFFF" style="height:35px;">
            <td class="itemorder" align="center"><?php echo $i;?></td>
            <td class="itemorder"><?php echo $show['Youcart']['code_product']?></td>
            <td class="itemorder tenprooder">
            
            <?php  echo $this->Html->link($show['Youcart']['name_product'], array('controller' => 'view_products', 'action' => 'index',$show['Youcart']['id_product'],$show['Youcart']['alias'].'.html'),array('style'=>'text-decoration:none; color:#384F5A;'));?>
            </td>             
            <td class="itemorder costprooder"><?php echo number_format($show['Youcart']['cost_product']*10/100 + $show['Youcart']['cost_product'])?> VNĐ</td> 
            <td class="itemorder costprooder"><?php echo number_format($show['Youcart']['cost_product'])?> VNĐ</td> 
            <td class="itemorder" align="center">
            <input name="data[Youcart][sl_<?php echo $show['Youcart']['id'] ?>]"  size="4" value="<?php echo $show['Youcart']['quantity_product']?>" type="text">
            <input name="data[ID][id_<?php echo $show['Youcart']['id'] ?>]"  size="4" value="<?php echo $show['Youcart']['id']?>" type="hidden">
            </td>
            <td class="itemorder costprooder"><?php $toal=$show['Youcart']['cost_product'] * $show['Youcart']['quantity_product']; echo number_format($toal);?> VNĐ</td>
             <td class="itemorder costprooder"><?php $pv=$toal/ 20000; echo $pv;?> </td>
             <td class="itemorder" align="center"><input  name="check[]" id="industry1" value="<?php echo $show['Youcart']['id']?>" type="checkbox"></td>
          </tr>
         <?php }?>
         </form>
            <tr bgcolor="#FFFFFF" style="height:35px;">
            <td colspan="3" align="center">
              <input name="btnthanhtoan" id="btnthanhtoan" value="Thanh toán" onclick="relink('<?php echo System?>/orders');" type="button" style="border:none; cursor:pointer; background:#FFF;" title="Thanh toán">
              <input name="btntiep" id="btntiep" value="Mua hàng" onclick="relink('<?php echo System?>/products/index/16/san-pham.html');" type="button" style="border:none; cursor:pointer; background:#FFF;" title="Mua hàng">
              <input name="btntinh" id="btntinh" value="Cập nhật" onclick="resubmit('frmorder','<?php echo System?>/infors/updatecarts');" type="button"style="border:none; cursor:pointer; background:#FFF;" title="Cập nhật"></td>
              <?php 
			  		$tong_tien=0;
					foreach($shows as $tien){
						$tong_tien=$tong_tien + ($tien['Youcart']['cost_product'] * $tien['Youcart']['quantity_product'] );
				  		
				  }?>
            <td colspan="3" align="left" style="color:#F00 ;font-weight:bold;">Tổng tiền : <?php echo number_format($tong_tien)?> VNĐ</td>
            <td colspan="3" align="left" style="color:#F00; font-weight:bold;">Tổng PV : <?php $tog_pv = $tong_tien / 20000; echo $tog_pv?></td>
            </tr>
        
        </tbody></table>
        </div>               
			
	</div>
	<span class="clear"></span>
</div>